/**
 * Created by 123 on 2017/12/26.
 * 站长下发的任务列表
 */
import React from 'react';
import {
  View,
  Text
} from 'react-native';
import {connect} from 'dva-no-router';
import {bindActionCreators} from 'redux'
import UI from '../../components/master/TaskList';
class App extends React.Component {
  componentDidMount() {
    const {query}=this.props;
    query(0);
  }
  componentWillUnmount(){
      const {getClean}=this.props;
      getClean();
  }
  render() {
    return (
      <UI {...this.props}/>
    )
  }
}

const mProps = ({masterTaskList}) => ({...masterTaskList})

const actions = {
  query: (val) => ({type: 'masterTaskList/query',payload:{tabNum:val}}),

  setEnable: (id) => ({type: 'masterTaskList/setEnable', payload: id}),

  resetTaskForm: () => ({type: 'masterTaskForm/resetData'}),

  getClean:() =>({type:'masterTaskList/getClean'}),

    setTaskId:(id) =>({type:'masterTaskList/setTaskId',payload:id})
};

const mActions = dispatch => ({
  ...bindActionCreators({...actions}, dispatch)
});


export default connect(mProps, mActions)(App)